package com.hzdesk.media.koreabatchmatvector.logic.view;

import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.widget.RelativeLayout;

import com.hzdesk.media.koreabatchmatvector.R;
import com.hzdesk.media.koreabatchmatvector.logic.contract.ShowLogeContract;
import com.hzdesk.media.koreabatchmatvector.logic.persenter.ShowLogePersenter;
import com.hzdesk.media.koreabatchmatvector.receiver.SDCardReceiver;

/**
 * Created by Administrator on 2018/7/24.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class ShowLogeActivity extends BaseActivity  implements ShowLogeContract.IShowLogeView {


    private ShowLogePersenter mShowLogePersenter = new ShowLogePersenter(this);
    private RecyclerView mRecyclerView;
    private RelativeLayout rl_bg;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_loge);
        mRecyclerView = findViewById(R.id.activity_show_loge_recyclerview);
        rl_bg = findViewById(R.id.activity_show_loge_rl_bg);
       // mShowLogePersenter.RegisterReceiver(this);
        mShowLogePersenter.initRecyclerView(mRecyclerView,this);
        //todo 记录选择的图片路径
    }

    @Override
    protected void onStart() {
        super.onStart();
        final SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        int selector = mSharedPreferences.getInt("item_skin",0); //todo 名称
        rl_bg.setBackgroundResource(updateBg[selector]);
        mShowLogePersenter.GetWatermarkFileDate(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
       // mShowLogePersenter.UnregisterReceiver(this);
    }
}
